<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<fmt:setBundle basename="ApplicationMessage" />
<fmt:setLocale value="zh_CN" />

<div class="modal-dialog x-modal-dialog" style="width:600px; margin-top: 150px;">

  <div class="modal-content">

    <div class="modal-header x-breadcrumb no-bottom-border clearfix">

      <h2><i class="glyphicon glyphicon-fire" title="手动支付"></i>&nbsp;&nbsp;手动支付</h2>

      <button type="button" class="close" data-dismiss="modal">&times;</button>

    </div>

    <form class="form-horizontal" method="POST" action="${ctx.host}/${type}-orders/${order.id}/pay" data-validate="true">

     <input type="hidden" name="_method" value="PATCH">
     <input type="hidden" name="orderId" value="${order.id}">
    
      <div class="modal-body">
        <div class="form-group x-form-group">
            <label class="col-xs-3 control-label">支付方式</label>
            <div class="pull-left col-xs-8">
              <select name="paymentMethod" class="form-control" data-validate="required">
                <option value=""></option>
                <c:forEach var="paymentMethod" items="${enums['paymentMethod']}">
                  <option value="${paymentMethod}">${paymentMethod.description}</option>
                </c:forEach>
              </select>
            </div>
          </div>
          <c:if test="${order.orderType.online}">
            <div class="form-group x-form-group order-number hide">
              <label class="col-xs-3 control-label">订单号</label>
              <div class="pull-left col-xs-8">
                <input type="text" name="orderNumber" value="" class="form-control" placeholder="请输入订单号" data-validate="required">
              </div>
            </div>
          </c:if>
          <%-- <div class="form-group x-form-group">
            <label class="col-xs-3 control-label">支付金额</label>
            <div class="pull-left col-xs-8">
              <input type="text" name="paidPrice" value="${order.payingPrice/100}" class="form-control" placeholder="请输入支付金额" data-validate="required|max_decimal_digit,2|min,0.00|max,${order.payingPrice/100}">
            </div>
          </div> --%>
      </div>

      <div class="modal-footer clearfix">
        <button type="submit" class="btn btn-success btn-shadow btn-shadow-success x-btn">确定</button>&nbsp;&nbsp;&nbsp;&nbsp;
        <button type="button" class="btn btn-default btn-shadow btn-shadow-default x-btn" data-dismiss="modal">取消</button>
      </div>
    </form>

  </div>

</div>

<script src="${ctx.resource}/js/bootstrap.validate.trigger.js"></script>
<script type="text/javascript">
$(function(){
    
    $('select[name="paymentMethod"]').select2({
      placeholder : '请选择支付方式',
      minimumResultsForSearch : 5,
      allowClear : true,
    });
    
  })
</script>